Add language support handling guidelines to Copilot Instructions - #249
Merged
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: randalex-de <3855487+randalex-de@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add instructions for language support in frontend and backend
Add language support handling guidelines to Copilot Instructions
Oct 19, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive documentation to the Copilot instructions for handling language support differently between frontend and backend contexts in the Warehouse add-on. The documentation clarifies the critical distinction between using Warehouse::getLabel() for frontend fragments and rex_i18n::msg() for backend components.
- Enhanced existing fragment development guidelines with detailed language support rules
- Added a new critical code quality section specifically focused on language support best practices
- Provided clear examples and explanations of why the separation is essential for shop customization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR addresses issue regarding language support handling by adding comprehensive documentation to
.github/copilot-instructions.mdthat clearly explains the critical difference between frontend and backend language support methods.Problem
The codebase uses two different approaches for language support, and it's essential that developers (and AI assistants) use the correct method based on context:
rex_i18n::msg()class ortranslate:keyplaceholderfragments/bootstrap5/and emails): Uses onlyWarehouse::getLabel()!Without clear documentation, it's easy to mix these approaches, which can break the shop's customization capabilities.
Changes
Added detailed language support guidelines in two strategic locations:
1. Fragment Development Guidelines (Section 6)
Enhanced the existing "Labels und Texte" section with:
2. Code Quality & Best Practices (New Section 7)
Added a new CRITICAL guideline section that includes:
Why This Matters
The separation is critical because:
Warehouse::getLabel()) are dynamic and can be customized by shop operators through the backend Settings → Label interfacerex_i18n::msg()) are static translations stored in/lang/*.langfiles that should remain consistent across installationsExample Usage
Frontend Fragment (Correct):
Backend Page (Correct):
This documentation ensures consistency across the codebase and prevents common mistakes when developing new features or fixing bugs.
Fixes: Issue about handling language support differently between frontend and backend
Original prompt
Fixes #248
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.